const express = require('express')
const app = express()
app.get('/server', (request, response) => {
    response.setHeader('Access-Control-Allow-Origin', '*')
    // 响应一个数据
    const data = {
        name: 'atguigu'
    }
    // 对对象进行一个字符串的转化
    let str = JSON.stringify(data)
    // response.send('zydcm')
    response.send(str)
})
app.listen(8000, () => {
    console.log('服务已经启动...')
})